#ifndef SDGRAPHICS_H
#define SDGRAPHICS_H

#ifdef __APPLE__
	#include "OpenGL/gl.h"
	#include "OpenGL/glu.h"
	#include <GLUT/glut.h>
#else
#ifdef WIN32
	#include <windows.h>
#endif
	#include <GL/gl.h>
	#include <GL/glu.h>
	#include <GL/glut.h>
#endif

#include <math.h>
#include <set>
#include "../src/chipmunk.h"
#include "sdUniverse.h"
#include "sdObject.h"
#include "sdTimed.h"
#include "sdShip.h"
#include <stdlib.h>

#define SLEEP_TICKS 16
#define HEIGHT 900
#define WIDTH 1200

//Does all the displaying for the game
class sdGraphics {
private:
    static sdUniverse* universe_; //Pointer to the universe that this graphics is displaying
    static void drawObject(void *ptr, void *unused); //Draw a game object
    static void drawPolyShape(cpShape *shape, sdObject* object); //Draw a poly shape
    static void drawSegmentShape(cpShape *shape, sdObject* object); //Draw a segment shape
    static void drawCircleShape(cpShape *shape, sdObject* object); //etc...
    static void drawCircle(cpFloat x, cpFloat y, cpFloat r, cpFloat a);
    static void drawCollisions(void *ptr, void *data);
    static void timercall(int value); //Stalls each frame of the game a set amount
    static void display(); //The entire draw step
    static void initGL(); //Init opengl things

public:
    static void init(sdUniverse* u, int width, int height, int argc, const char *argv[]); //Init graphics object
};

#endif
